<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<title></title>
		<script type="text/javascript" src="../../js/jquery.1.9.1.min.js"></script>
		<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=2ZFQFZz98wuvY5PTjli3foh2KnGvCDfz"></script>
	</head>
	<body>
		
		<iframe id="main" style="height=100%; width=80%;" src="http://www.sina.com"></iframe>
		
		<!--<script>
			var terminal ="长沙火车站";
			  $.ajax({                
                    type: "GET",
                    timeout:50000,               
                    url: 'http://api.map.baidu.com/geocoder/v2/?address='+terminal+'&output=json&coord_type=wgs84&ak=2ZFQFZz98wuvY5PTjli3foh2KnGvCDfz&callback=showLocation',
                    dataType:"jsonp",
                    async: false,     
                    success: function(data){
                        console.log(JSON.stringify(data));
                        var lat = data['result']['location']['lat'];
                        var lng = data['result']['location']['lng'];
                        $.ajax({                
                            type: "GET",
                            timeout:50000,               
                            url: 'http://api.map.baidu.com/geocoder/v2/?location='+lat+','+lng+'&output=json&coord_type=wgs84&ak=2ZFQFZz98wuvY5PTjli3foh2KnGvCDfz&callback=showLocation',
                            dataType:"jsonp",
                            async: false,    
                            success: function(data){
                                // console.dir(data['result']['addressComponent']['city']);
                                city = data['result']['addressComponent']['city'];
                                // alert(city);
                                if(terminal != ''){
                                    var geolocation = new BMap.Geolocation();
                                    var gc = new BMap.Geocoder(); 
                                    geolocation.getCurrentPosition(function(r){
                                        if(this.getStatus() == BMAP_STATUS_SUCCESS){
                                            // alert('您的位置：'+r.point.lng+','+r.point.lat);
                                            var pt = r.point; 
                                            gc.getLocation(pt, function(rs){    
                                                var addComp = rs.addressComponents;    
                                                // location.href = 'http://api.map.baidu.com/direction?origin=latlng:'+r.point.lat+','+r.point.lng+'|name:我的位置&destination=latlng:'+lat+','+lng+'|name:'+terminal+'&mode=driving&origin_region='+addComp.city+'&destination_region='+city+'&output=html&src=yourCompanyName|yourAppName';
                                                function plusReady(){
                                                    // 设置目标位置坐标点和起始位置坐标点
                                                    var src = new plus.maps.Point(r.point.lng,r.point.lat); // 起始位置 
                                                    var dst = new plus.maps.Point(lng,lat); //
                                                    // 调用系统地图显示 
                                                    plus.maps.openSysMap( dst, terminal, src );
                                                }
                                                if(window.plus){
                                                    plusReady();
                                                }else{
                                                    document.addEventListener("plusready",plusReady,false);
                                                }
                                            });  

                                        }
                                        else {
                                            alert('failed'+this.getStatus());
                                        }        
                                    },{enableHighAccuracy: true})
                                }
                            },
                            error:function(){
                                alert("网络异常");
                            }

                        });
                    },
                    error:function(){
                        alert("网络异常");
                    }

                });

		</script>
		-->
	</body>
</html>
